package com.stefanini.pe.bbva.bp.in.report;

import java.text.AttributedString;

import org.jfree.chart.labels.PieSectionLabelGenerator;
import org.jfree.data.general.PieDataset;

public class CustomLabelGenerator implements PieSectionLabelGenerator
{

	public String generateSectionLabel(PieDataset dataset, Comparable key)
	{
	    String temp = "";
	    if(dataset != null)
	    {
	        temp = dataset.getValue(key).toString();
	        
	        if(temp.contains(":")){
	        	String[] campos= temp.split(":");
	        	return campos[1];
	        }else{
	        	return temp;	        	
	        }
	    }
	    return temp;
	}
	
	public AttributedString generateAttributedSectionLabel(PieDataset arg0, Comparable arg1)
	{
	    return null;
	}
	
	public CustomLabelGenerator()
	{
	}
}